﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CDB.LinqModel.Data;
using CDB.LinqData;
using CDB.LinqModel;

public partial class popUpBuilders : System.Web.UI.Page
{
    #region Variable Declaration
    IDataRepository _dataObject = new DataRepository();
    Builder builder;
    #endregion

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["Id"] != null)
            {
                bindBuilder(Request.QueryString["Id"].ToString());
            }
        }
    }
    private void bindBuilder(string Id)
    {
        builder = new Builder(_dataObject);
        builder.Id = Convert.ToInt32(Id);

        builder.GetBuilderById();

        if (builder.Id != 0)
        {
            spBuilderName.InnerText = builder.Name;
            tdName.InnerText = builder.Name;
            //tdProfile.InnerHtml = builder.OngoingProjects;
            //tdProjects.InnerHtml = builder.CompletedProjects;
            img.Src = "builders/" + builder.Image;
        }
    }
}